package com.xc.stock.constant;

/**
 * 资金类型
 *
 * @author xlfd
 * @email xlfd@gmail.com
 * @version 1.0
 * @created Jan 13, 2021 11:53:31 AM
 */
public enum AccountType {
//	STOCK_LOAN("STOCK_LOAN", "融资融券", "300010", false),
	
	STOCK("STOCK", "证券", "10", true),
//	FUND("FUND", "基金", "11", true),
	
//	CHANGE("CHANGE", "钱包账户", "3000", true),
	;

	String code;
	String remark;
	String prefix;
	boolean withdrawFlag;
//	Currency currency;
	AccountType(String code, /**Currency currency,**/ String remark, String prefix, boolean withdrawFlag) {
		this.code = code;
		this.remark = remark;
		this.prefix = prefix;
		this.withdrawFlag = withdrawFlag;
//		this.currency = currency;
	}

//	public Currency currency() {
//		return currency;
//	}
	public String code() {
		return code;
	}

	public String prefix() {
		return prefix;
	}
	
	public boolean withdrawFlag() {
		return withdrawFlag;
	}
	
	public String remark() {
		return remark;
	}

	public static AccountType of(String code) {
		AccountType[] values = AccountType.values();
		for (AccountType e : values) {
			if (e.code.equals(code)) {
				return e;
			}
		}

		return null;
	}

	public static String remark(String code) {
		AccountType of = of(code);
		return of == null ? "" : of.remark;
	}
}
